package com.tencreat.domain.mall;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * 砍价商品对象 mall_goods_cut
 *
 * @author wangkai
 * @date 2021-11-04
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("mall_goods_cut")
public class MallGoodsCut extends BaseEntity<MallGoodsCut> {
    private static final long serialVersionUID = 1L;


    /**
     * $column.columnComment
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /**
     * 商品编号
     */
    @Excel(name = "商品编号")
    @ApiModelProperty(value = "商品编号")
    @TableField("`goods_sn`")
    private String goodsSn;
    /**
     * 砍价活动编号
     */
    @Excel(name = "砍价活动编号")
    @ApiModelProperty(value = "砍价活动编号")
    @TableField("`cut_sn`")
    private String cutSn;


    /**
     * 货品id
     */
    @Excel(name = "商品id")
    @ApiModelProperty(value = "商品id")
    @TableField("`goods_id`")
    private Long goodsId;

    /**
     * 货品id
     */
    @Excel(name = "货品id")
    @ApiModelProperty(value = "货品id")
    @TableField("`product_id`")
    private Long productId;

    /**
     * 砍价商品底价
     */
    @Excel(name = "可砍价金额")
    @ApiModelProperty(value = "可砍价金额")
    @TableField("`cut_price`")
    private BigDecimal cutPrice;


    /**
     * 砍价商品原价
     */
    @Excel(name = "砍价商品原价")
    @ApiModelProperty(value = "砍价商品原价")
    @TableField("`origin_price`")
    private BigDecimal originPrice;


    /**
     * 砍价次数（每人限制一次）
     */
    @Excel(name = "砍价次数", readConverterExp = "每=人限制一次")
    @TableField("`cut_count`")
    private Long cutCount;


    /**
     * 砍价结束时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "砍价结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("`cut_end_time`")
    private LocalDateTime cutEndTime;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "砍价开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("`cut_start_time`")
    private LocalDateTime cutStartTime;

    /**
     * 砍价时长
     */
    @Excel(name = "砍价时长")
    @ApiModelProperty("砍价时长,单位:小时")
    @TableField("`cut_time`")
    private BigDecimal cutTime;


    /**
     * 参与人数
     */
    @Excel(name = "参与人数")
    @ApiModelProperty(value = "参与人数")
    @TableField("`join_count`")
    private Long joinCount;


    /**
     * 销量
     */
    @Excel(name = "销量")
    @ApiModelProperty(value = "销量")
    @TableField("`sales_count`")
    private Long salesCount;
    /**
     * 租户号
     */
    @Excel(name = "租户号")
    @ApiModelProperty(value = "租户号")
    @TableField("`tenant_id`")
    private String tenantId;


    /**
     * 启动标识（0未启动,1启动）
     */
    @Excel(name = "启动标识", readConverterExp = "0=未启动,1启动")
    @TableField("`is_enable`")
    private String isEnable;


    /**
     * 显示顺序
     */
    @Excel(name = "显示顺序")
    @TableField("`sort`")
    @ApiModelProperty("显示顺序")
    private Integer sort;


    /**
     * 专区id
     */
    @Excel(name = "专区id")
    @TableField("`zone_id`")
    @ApiModelProperty("专区id")
    private Integer zoneId;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @Excel(name = "删除标志（0代表存在 2代表删除）")
    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）")
    @TableField("`del_flag`")
    private String delFlag;

    @ApiModelProperty("商品底价")
    private BigDecimal lowPrice;

    @ApiModelProperty(value= "是否分佣 1-是 0-否")
    private Integer isBonus;
}
